package org.seven.jrdp.commons.util;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.seven.jrdp.commons.constant.GlobalContants;
import org.seven.jrdp.commons.shiro.model.User;

public abstract class ShiroUtils {
	public static Session getSession() {
		return SecurityUtils.getSubject().getSession();
	}

	public static void setUser(User user) {
		getSession().setAttribute(GlobalContants.SESSION_USER, user);
	}

	public static User getUser() {
		return (User) getSession().getAttribute(GlobalContants.SESSION_USER);
	}
}